/*
 * @Description:
 * @Author: py
 * @Date: 2024-07-30
 */
import { reactive } from 'vue'

export function useTable() {
    const gridOptions = reactive<any>({
        align: 'center',
        border: true,
        columnConfig: {
            resizable: true,
        },
        columns: [
            { type: 'seq', width: 70, title: '序号' },
            { field: 'name', minWidth: 150, title: '会所名称' },
            { field: 'description', title: '会所介绍', minWidth: 200 },
            { field: 'address', title: '地址', minWidth: 200 },
            { field: 'phone', title: '联系电话', width: 120 },
            { slots: { default: 'createTime' }, title: '创建时间', width: 200 },
            { fixed: 'right', slots: { default: 'operate' }, title: '操作', width: 150 },
        ],
        data: [],
        height: 530,
        loading: false,
        showOverflow: false,
        toolbarConfig: {
            slots: {
                buttons: 'toolbar_buttons',
            },
        },
    })

    return { gridOptions }
}

export function useReservationTable() {
    const gridOptions = reactive<any>({
        align: 'center',
        border: true,
        columnConfig: {
            resizable: true,
        },
        columns: [
            { type: 'seq', width: 50, title: '序号' },
            { field: 'userName', width: 150, title: '用户名称' },
            { field: 'communityName', title: '项目名称', minWidth: 200 },
            { field: 'spaceName', title: '资源名称', minWidth: 200 },
            { slots: { default: 'address' }, title: '地址', minWidth: 200 },
            { field: 'phone', title: '联系电话', width: 120 },
            { slots: { default: 'createTime' }, title: '创建时间', width: 200 },
            // { fixed: 'right', slots: { default: 'operate' }, title: '操作', width: 150 },
        ],
        data: [],
        height: 530,
        loading: false,
        showOverflow: false,
        toolbarConfig: {
            slots: {
                buttons: 'toolbar_buttons',
            },
        },
    })

    return { gridOptions }
}
